import {useEffect} from 'react'
import WHeaders from '@/components/WHeaders';
import WTables from '@/components/WTables';
import type { TableColumnsType } from "antd";
import { Finance2 } from '@/stores/Finance2';
import { useSnapshot } from 'valtio';
export default function StoreSalesDaily() {
  const finance=useSnapshot(Finance2);
  interface DataType {
    key: string;
    brand?: string;// 品牌
    partition?: string;// 区域
    platform?: string; // 平台
    shop?: string; // 店铺
    Platformsettlementamount:number;
    Platformactivitysubsidyamount:number;
    sum:number,
    children?: DataType[];
    date: string; // 日期
  }
  const columns: TableColumnsType<DataType> = [
    {
      title: '品牌',
      dataIndex: 'brand',
      key: "1"
    },
    {
      title: '分区',
      dataIndex: 'partition',
      key: "2"
    },
    {
      title: '店铺',
      dataIndex: 'shop',
      key: "3"
    },
    {
      title: '第三方平台',
      dataIndex: 'platform',
      key: "4"
    },
    {
      title: '平台结算金额',
      dataIndex: 'Platformsettlementamount',
      key: "5"
    },
    {
      title: '平台活动补贴金额',
      dataIndex: 'Platformactivitysubsidyamount',
      key: "6"
    },
    {
      title: '合计', dataIndex: 'sum',
      key: "7",
    }
  ];
  useEffect(() => {
    finance.getList();
  }, []);
  return (
    <div>
       <WHeaders finance={Finance2}></WHeaders>
       <WTables columns={columns} data={finance.data} title={"店铺对账单"}></WTables>
    </div>
  )
}
